load("//tools/build_defs/android:fb_core_android_library.bzl", "fb_core_android_library")
load("//tools/build_defs/oss:profilo_defs.bzl", "profilo_path")

CALLBACKS_SRC = ["NativeTraceWriterCallbacks.java"]

fb_core_android_library(
    name = "writer",
    srcs = glob(
        ["*.java"],
        exclude = CALLBACKS_SRC,
    ),
    labels = [],
    visibility = [
        profilo_path("..."),
    ],
    deps = [
        profilo_path("cpp:profilo"),
        profilo_path("java/main/com/facebook/profilo/mmapbuf/core:core"),
        profilo_path("deps/fbjni:fbjni-java"),
        profilo_path("deps/jsr-305:jsr-305"),
        profilo_path("deps/proguard:annotations"),
        profilo_path("deps/soloader:soloader"),
    ],
    exported_deps = [
        ":writer_callbacks",
    ],
)

fb_core_android_library(
    name = "writer_callbacks",
    srcs = glob(CALLBACKS_SRC),
    labels = [],
    visibility = [
        profilo_path("..."),
        "//fbandroid/perftests/benchmarks/java/com/facebook/benchmarks/profilo/...",
    ],
    deps = [
        profilo_path("deps/proguard:annotations"),
    ],
)
